/* 组织架构api */
import request from '@/utils/request'

// 导出方法
// 1.获取组织架构的方法
export const reqGetDepartments = () => {
  return request.get('/company/department')
}

// 2.根据id删除部门
export const reqDelDepartmentById = id => {
  return request({
    method: 'delete',
    url: `/company/department/${id}`,
  })
}

// 3.新增部门
export const reqPostDepartment = data => {
  return request({
    method: 'post',
    url: `/company/department`,
    data,
  })
}

// 4.根据id查询部门详情
export const reqGetDepartmentById = id => {
  return request.get(`/company/department/${id}`)
}

// 5.根据id修改部门详情
export const reqEditDepartmentById = data => {
  return request({
    method: 'put',
    url: `/company/department/${data.id}`,
    data,
  })
}
